/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package models;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;

/**
 *
 * @author Eduardo
 */
@Entity
@Table(name = "Horario_Trabajo")
@NamedQueries({
    @NamedQuery(name = "HorarioTrabajo.findAll", query = "SELECT h FROM HorarioTrabajo h"),
    @NamedQuery(name = "HorarioTrabajo.findByIdHorarioT", query = "SELECT h FROM HorarioTrabajo h WHERE h.idHorarioT = :idHorarioT"),
    @NamedQuery(name = "HorarioTrabajo.findByDescripcion", query = "SELECT h FROM HorarioTrabajo h WHERE h.descripcion = :descripcion"),
    @NamedQuery(name = "HorarioTrabajo.findByHoraIni", query = "SELECT h FROM HorarioTrabajo h WHERE h.horaIni = :horaIni"),
    @NamedQuery(name = "HorarioTrabajo.findByEstado", query = "SELECT h FROM HorarioTrabajo h WHERE h.estado = :estado"),
    @NamedQuery(name = "HorarioTrabajo.findByHoraFin", query = "SELECT h FROM HorarioTrabajo h WHERE h.horaFin = :horaFin")})
public class HorarioTrabajo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IdHorarioT")
    private Integer idHorarioT;
    @Size(max = 100)
    @Column(name = "Descripcion")
    private String descripcion;
    @Column(name = "HoraIni")
    @Temporal(TemporalType.TIME)
    private Date horaIni;
    @Column(name = "Estado")
    private Integer estado;
    @Column(name = "HoraFin")
    @Temporal(TemporalType.TIME)
    private Date horaFin;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "horarioTrabajo", fetch = FetchType.LAZY)
    private List<Horarioxlocal> horarioxlocalList;

    public HorarioTrabajo() {
    }

    public HorarioTrabajo(Integer idHorarioT) {
        this.idHorarioT = idHorarioT;
    }

    public Integer getIdHorarioT() {
        return idHorarioT;
    }

    public void setIdHorarioT(Integer idHorarioT) {
        this.idHorarioT = idHorarioT;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Date getHoraIni() {
        return horaIni;
    }

    public void setHoraIni(Date horaIni) {
        this.horaIni = horaIni;
    }

    public Integer getEstado() {
        return estado;
    }

    public void setEstado(Integer estado) {
        this.estado = estado;
    }

    public Date getHoraFin() {
        return horaFin;
    }

    public void setHoraFin(Date horaFin) {
        this.horaFin = horaFin;
    }

    public List<Horarioxlocal> getHorarioxlocalList() {
        return horarioxlocalList;
    }

    public void setHorarioxlocalList(List<Horarioxlocal> horarioxlocalList) {
        this.horarioxlocalList = horarioxlocalList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idHorarioT != null ? idHorarioT.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HorarioTrabajo)) {
            return false;
        }
        HorarioTrabajo other = (HorarioTrabajo) object;
        if ((this.idHorarioT == null && other.idHorarioT != null) || (this.idHorarioT != null && !this.idHorarioT.equals(other.idHorarioT))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "models.HorarioTrabajo[ idHorarioT=" + idHorarioT + " ]";
    }
    
}
